/**
 * 精灵类，主要做容器使用
 * @author zzhanglin 
 */
Sprite = function()
{
	DisplayObjectContainer.call( this );
	this.className = "Sprite";
	
	this._graphics ;
};
FLASH.extend( Sprite , DisplayObjectContainer ) ;

/**
 * 获取绘图类
 */
Sprite.prototype.getGraphics = function()
{
	if(!this._graphics){
		this._graphics = new Graphics();
	}
	return this._graphics ;
};
/**
 * 清除资源
 */
Sprite.prototype.dispose = function()
{
	DisplayObjectContainer.prototype.dispose.call(this);
	if(this._graphics){
		this._graphics._dispose();
		this._graphics = null ;
	}
};
/**
 * 显示图形
 * @param globalAlpha 
 * @param context
 */
Sprite.prototype._draw =function( globalAlpha,context )
{
	if(!this._graphics) return ;
	//画图
	context.globalAlpha=globalAlpha ;
	context.setTransform( this._worldModelMatrix._a ,this._worldModelMatrix._b,this._worldModelMatrix._c,this._worldModelMatrix._d,
			this._worldModelMatrix._tx,this._worldModelMatrix._ty );
	context.drawImage(this._graphics._getContextCanvas(), 0 , 0 );
};